package com.kangyi.user.mapper;

import com.kangyi.user.annotation.AutoFill;
import com.kangyi.entity.FourHigh;
import com.kangyi.enumeration.OperationType;
import com.kangyi.vo.FourHighVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author Blank
 * @version 1.0
 */
@Mapper
public interface FourHighMapper {

    @Insert("insert into four_high(guest_id, blood_sugar, blood_pressure_systolic, blood_pressure_diastolic, blood_lipids, uric_acid,status, create_user, update_user,create_time,update_time) " +
            "VALUES (#{guestId},#{bloodSugar},#{bloodPressureSystolic},#{bloodPressureDiastolic},#{bloodLipids},#{uricAcid},#{status},#{createUser},#{updateUser},#{createTime},#{updateTime})")
    @AutoFill(value = OperationType.INSERT)
    void addFourHigh(FourHigh fourHigh);

    @Delete("delete from four_high where guest_id = #{guestId};")
    void deleteFourHigh(Integer guestId);

    @AutoFill(value = OperationType.UPDATE)
    void updateFourHigh(FourHigh fourHigh);

    @Select("select * from four_high where guest_id = #{guestId} order by create_time desc limit 1")
    FourHighVO getById(Integer id);
}
